//
// Created by kzime on 17-10-30.
//

#include <bits/stdc++.h>
using namespace std;

char buf[(int)3e7], *fs = buf;

inline int gn() {
    int k = 0;
    char c = *fs++;
    for (; !isdigit(c); c = *fs++);
    for (; isdigit(c); c = *fs++) k = k * 10 + c - '0';
    return k;
}

int x, y, z, dp[103][103][103], n;

int main() {
    freopen("../in", "r", stdin);
    fread(buf, 1, (int)3e7, stdin);
    x = gn(), y = gn(), z = gn();
    n = x + y + z;
    for (register int i = 1, a, b, c; i <= n; i++) {
        a = gn(), b = gn(), c = gn();
        for (int j = 0; j <= x; j++) {
            for (int k = 0; k <= y; k++) {
                if (k >= 1) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + b);
                if (j >= 1) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + a);
                dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k] + c);
            }
        }
    }
    cout << dp[n][x][y];
}
